<template>
  <div>孙子组件--{{ username }}</div>
</template>

<script setup>
import { inject } from "vue";
// 语法: const 变量名 = inject('祖先组件提供的属性名)
const username = inject("usernameprop");
</script>
<style scoped>
</style>